/**
 */
package de.thwildau.tm.moses.avro.avdl.impl;

import de.thwildau.tm.moses.avro.avdl.AvdlPackage;
import de.thwildau.tm.moses.avro.avdl.Throws;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Throws</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.avro.avdl.impl.ThrowsImpl#getError <em>Error</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ThrowsImpl extends MinimalEObjectImpl.Container implements Throws
{
  /**
   * The cached value of the '{@link #getError() <em>Error</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getError()
   * @generated
   * @ordered
   */
  protected de.thwildau.tm.moses.avro.avdl.Error error;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ThrowsImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return AvdlPackage.Literals.THROWS;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public de.thwildau.tm.moses.avro.avdl.Error getError()
  {
    if (error != null && error.eIsProxy())
    {
      InternalEObject oldError = (InternalEObject)error;
      error = (de.thwildau.tm.moses.avro.avdl.Error)eResolveProxy(oldError);
      if (error != oldError)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, AvdlPackage.THROWS__ERROR, oldError, error));
      }
    }
    return error;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public de.thwildau.tm.moses.avro.avdl.Error basicGetError()
  {
    return error;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setError(de.thwildau.tm.moses.avro.avdl.Error newError)
  {
    de.thwildau.tm.moses.avro.avdl.Error oldError = error;
    error = newError;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AvdlPackage.THROWS__ERROR, oldError, error));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case AvdlPackage.THROWS__ERROR:
        if (resolve) return getError();
        return basicGetError();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case AvdlPackage.THROWS__ERROR:
        setError((de.thwildau.tm.moses.avro.avdl.Error)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case AvdlPackage.THROWS__ERROR:
        setError((de.thwildau.tm.moses.avro.avdl.Error)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case AvdlPackage.THROWS__ERROR:
        return error != null;
    }
    return super.eIsSet(featureID);
  }

} //ThrowsImpl
